package br.univas.vperiod.jowey.entities;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="player")
public class Player implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7478072256809140687L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private long registration;
	
	private String name;
	private String phone;
	private String email;
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="player",targetEntity=PlayerJob.class)
	private Set<PlayerJob> playerJobs;
	
	@ManyToOne(fetch=FetchType.EAGER)
	@JoinColumn(name="idPosition")
	private Position position;
	
	

	public long getRegistration() {
		return registration;
	}

	public void setRegistration(long registration) {
		this.registration = registration;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Set<PlayerJob> getPlayerJobs() {
		return playerJobs;
	}

	public void setPlayerJobs(Set<PlayerJob> playerJobs) {
		this.playerJobs = playerJobs;
	}

	public Position getPosition() {
		return position;
	}

	public void setPosition(Position position) {
		this.position = position;
	}
}
